import Vue from 'vue';
import Router from 'vue-router';
// import UserManagement from './components/UserManagement.vue';
import AuthForm from './components/AuthForm.vue';
import StatsView from './components/StatsView.vue';
import UserList from "@/components/UserList.vue";
import Login from "@/views/Login.vue";
import Register from "@/views/Register.vue";
import Dashboard from "@/views/Dashboard.vue";
import Home from "@/views/Home.vue";
import UploadAvatar from "@/components/UploadAvatar.vue";
// 让 Vue 使用 Router
Vue.use(Router);

const routes = [
  { path: '/home', component: Home },

  { path: '/login', component: Login },
  { path: '/register', component: Register },
  { path: '/dashboard', component: Dashboard },
  { path: '/uploadAvatar', component: UploadAvatar },



  {
    path: '/',
    component: Dashboard,
  },
  {
    path: '/auth',
    name: 'AuthForm',
    component: AuthForm,
  },
  {
    path: '/stats',
    name: 'StatsView',
    component: StatsView,
  },
  {
    path: '/userList',
    name: 'UserList',
    component: UserList,
  },
];

const router = new Router({
  mode: 'history', // 使用 HTML5 的历史模式
  routes,
});

export default router;
